package com.example.petstoreservice.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class Product {
    @Column(name="productId")
    private Long productId;
    @Column(name="productName")
    private String productName;
    @Column(name="description")
    private String description;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "categoryId")
    private Category category;
    @Column(name="categoryId")
    private Long categoryId;
    @Column(name="price")
    private BigDecimal price;
    @Column(name="stock")
    private Long stock;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "supplierId")
    private Supplier supplier;
    @Column(name="supplierId")
    private Long supplierId;
    @Column(name="imageUrl")
    private String imageUrl;
    @Column(name="videoUrl")
    private String videoUrl;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    @Column(name="createTime")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    @Column(name="updateTime")
    private Date updateTime;
    @Column(name="sold")
    private Integer sold;
    @Column(name="type")
    private String type;
    @Column(name="click")
    private Integer click;
}
